import request from '@/utils/request'
// import axios from 'axios'
import { apiVersion } from '@/config'
// import { getDeviceId } from '@/utils/tool'


// 获取详情
export function getProductDetail(data) {
    return request({
        url: `/admin/${apiVersion}/product/${data.id}`,
        method: 'get',
        data
    })
}
// 分页列表
export function getProducts(data) {
    return request({
        url: `/admin/${apiVersion}/product`,
        method: 'get',
        data
    })
}
// 删除
export function delProduct(data) {
    return request({
        url: `/admin/${apiVersion}/product/${data.id}`,
        method: 'delete',
        data
    })
}
// 创建
export function addProduct(data) {
    return request({
        url: `/admin/${apiVersion}/product`,
        method: 'post',
        data
    })
}

// 查询列表
export function getAllProducts(data) {
    return request({
        url: `/admin/${apiVersion}/product/all`,
        method: 'get',
        data
    })
}
